package cn.hznc.controller.toolImport;

import cn.hznc.controller.service.toolImport.ScanningGunImportService;
import cn.hznc.domain.request.schedule.QryDirectRetrievalReq;
import cn.hznc.domain.request.toolImport.BatchImportOfToolsReq;
import cn.hznc.domain.response.PageResult;
import cn.hznc.domain.response.ResponseBody;
import cn.hznc.vo.AssemblyRetrievalVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@CrossOrigin(origins = "*", maxAge = 3600)
@RequestMapping("/scanningGunImport")
@Slf4j
public class ScanningGunImportController {

    @Resource
    private ScanningGunImportService scanningGunImportService;

    @RequestMapping(value = "/checkToolIsExist", method = RequestMethod.GET)
    public ResponseBody test4(@RequestParam String uniqueId){
        try{
            scanningGunImportService.checkToolIsExist(uniqueId);
            return ResponseBody.success();
        }catch (Exception ex){
            return ResponseBody.error(ex.getMessage(),ex.getMessage());
        }
    }
    @RequestMapping(value = "/batchImportOfTools", method = RequestMethod.POST)
    public ResponseBody queryAssemblyRetrieval(@RequestBody BatchImportOfToolsReq batchImportOfToolsReq){
        return ResponseBody.success(scanningGunImportService.batchImportOfTools(batchImportOfToolsReq));
    }
}
